<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .card {
      position: relative;
      width: 200px;
      height: 200px;
      perspective: 600px;
    }
  
    .face,.back {
      position: absolute;
      inset: 0;
      text-align: center;
      transition: 2s;
    }
    .face {
      background-color: aliceblue;
      transform: rotateY(-180deg);
      backface-visibility: hidden;
    }
    .back {
      background-color: aquamarine;
      transform: rotateY(0deg);
      backface-visibility: hidden;
    }

    .card:hover .face{
      transform: rotateY(0deg);
    }
    .card:hover .back {
      transform: rotateY(180deg);
    }
    
  </style>
</head>
<body>
  <div class="card">
    <div class="face">
      123
    </div>
    <div class="back">
      fsagasfa
    </div>
  </div>
</body>
</html>